home *** CD-ROM | disk | FTP | other *** search
- Path: news.wwa.com!rmartin
- From: rmartin@oma.com (Robert C. Martin)
- Newsgroups: comp.object,comp.lang.c++,comp.realtime,comp.dcom.telecom.tech,comp.arch.embedded
- Subject: Re: Can OO be successful in real-time embedded systems?
- Date: 11 Apr 1996 16:32:22 GMT
- Organization: Object Mentor
- Message-ID: <RMARTIN.96Apr11113222@rcm.oma.com>
- References: <316BF0C5.1FE1@condat.de>
- NNTP-Posting-Host: rcm.oma.com
- In-reply-to: Henning Rietz's message of Wed, 10 Apr 1996 17:32:53 +0000
-
- In article <316BF0C5.1FE1@condat.de> Henning Rietz <rietz@condat.de> writes:
-
- For the last couple of weeks I have been involved in a major survey on
- the use of object oriented techniques in the area of telecommunications
- (mainly in the German speaking region).
- I can say "everybody" is using OO in some areas (mainly network
- management, switch provisioning, customer care), BUT there are (almost)
- no examples in the area of (small) embedded systems, main reasons for
- that being:
-
- - "OO systems are too slow"
- - "OO systems eat up too much memory"
-
- More than one of my clients are using OO and C++ in embedded,
- multi-threaded, real time systems, and they are getting along quite
- nicely. The systems I am talking about are extremely constrained.
- There are dozens of real time tasks with millisecond response times.
- There is a very limitted amount of memory. etc. They are concerned
- for every wasted microsecond. Yet they are finding that C++ and OOD
- are more than adequate to the task.
-
- What is it that would make OO slow? Some people contend that it is
- the time required for polymorphic dispatch. (i.e. figuring out which
- method to call when a message is recieved.) In C++ this is very very
- fast. Indeed I recently benchmarked a 486-33 using a popular
- compiler and found that the polymorphic dispatch time was 140ns.
-
- Moreover, polymorphic dispatch in OO applications replaces
- if-else or switch statements in equivalent procedural applications.
- So the comparison is probably moot. Neither is faster or slower than
- the other given a decent compiler.
-
- As to memory, C++ requires a bit more memory for managing the virtual
- tables. This amounts to one pointer per object, and one virtual table
- per class. Each virtual table contains one pointer per virtual
- function and probably a few other bytes for miscellaneous stuff.
- These tables can be placed in ROM.
-
- However, these tables and the virtual pointers replace switch/case
- tables or if/else code that would exist in the procedural counterpart.
- So the difference is probably moot.
-
- How far "down" does the application of OO really go?
-
- As far down as you like. C++ code in interrupt heads is not out of
- the question.
-
- How far will it go in the future?
-
- I anticipate no lower bound.
-
- Who develops commercial(!) embedded real-time systems
- using OO methods and languages?
-
- If you would like to contact me, I will ask my clients if they would
- be willing to share their experiences with you.
-
- Will OO ever be of major importance in that area?
-
- It already is.
- --
- Robert Martin | Design Consulting | Training courses offered:
- Object Mentor Assoc.| rmartin@oma.com | OOA/D, C++, Advanced OO
- 14619 N. Somerset Cr| Tel: (847) 918-1004 | Mgt. Overview of OOT
- Green Oaks IL 60048 | Fax: (847) 918-1023 | http://www.oma.com
-
-